package com.cy.pj.brand.dao;

import com.cy.pj.brand.pojo.Brand;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

@Mapper
public interface BrandDao {
    List<Brand> findBrands(String name);

    //    最好不要真正删除数据
    /*
     * @param (id)
     * @return 删除行数，当然也可以改成void*/
    @Delete("delete from dbrand where id=#{id}")
    int deleteById(int id);

    @Insert("insert into dbbrand(remark,name,createdTime) values(#{remark},#{name},#{createdTime})")
    int insert(String remark, String name, Date createdTime);

    @Select("select * from dbrand where id=#{id}")
    Brand selectById(Integer id);
}
